package singleResponsibility;

class User {
    private String name;
    private String email;

    public User(String name, String email) {
        this.name = name;
        this.email = email;
    }

    public void register() {
        // 注册用户
        System.out.println("User registered: " + name);

        // 发送电子邮件通知
        sendEmail();
    }

    private void sendEmail() {
        // 发送电子邮件
        System.out.println("Email sent to: " + email);
    }
}
